package com.example.mybatisplus.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.mybatisplus.entity.Emp;
import com.example.mybatisplus.service.EmpService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/emp")
@Api(tags = "员工管理")
public class EmpController {

    @Autowired
    private EmpService empService;

    @GetMapping("/allEq")
    @ApiOperation("使用allEq查询")
    public List<Emp> getAllEq(@RequestParam Map<String, Object> params) {
        return empService.getAllEq(params);
    }

    @GetMapping("/eq")
    @ApiOperation("使用eq查询")
    public List<Emp> getEq(@RequestParam String column, @RequestParam Object val) {
        return empService.getEq(column, val);
    }

    @GetMapping("/ne")
    @ApiOperation("使用ne查询")
    public List<Emp> getNe(@RequestParam String column, @RequestParam Object val) {
        return empService.getNe(column, val);
    }

    @GetMapping("/gt")
    @ApiOperation("使用gt查询")
    public List<Emp> getGt(@RequestParam String column, @RequestParam Object val) {
        return empService.getGt(column, val);
    }

    @GetMapping("/ge")
    @ApiOperation("使用ge查询")
    public List<Emp> getGe(@RequestParam String column, @RequestParam Object val) {
        return empService.getGe(column, val);
    }

    @GetMapping("/lt")
    @ApiOperation("使用lt查询")
    public List<Emp> getLt(@RequestParam String column, @RequestParam Object val) {
        return empService.getLt(column, val);
    }

    @GetMapping("/le")
    @ApiOperation("使用le查询")
    public List<Emp> getLe(@RequestParam String column, @RequestParam Object val) {
        return empService.getLe(column, val);
    }

    @GetMapping("/between")
    @ApiOperation("使用between查询")
    public List<Emp> getBetween(@RequestParam String column, @RequestParam Object val1, @RequestParam Object val2) {
        return empService.getBetween(column, val1, val2);
    }

    @GetMapping("/notBetween")
    @ApiOperation("使用notBetween查询")
    public List<Emp> getNotBetween(@RequestParam String column, @RequestParam Object val1, @RequestParam Object val2) {
        return empService.getNotBetween(column, val1, val2);
    }

    @GetMapping("/like")
    @ApiOperation("使用like查询")
    public List<Emp> getLike(@RequestParam String column, @RequestParam String val) {
        return empService.getLike(column, val);
    }

    @GetMapping("/notLike")
    @ApiOperation("使用notLike查询")
    public List<Emp> getNotLike(@RequestParam String column, @RequestParam String val) {
        return empService.getNotLike(column, val);
    }

    @GetMapping("/likeLeft")
    @ApiOperation("使用likeLeft查询")
    public List<Emp> getLikeLeft(@RequestParam String column, @RequestParam String val) {
        return empService.getLikeLeft(column, val);
    }

    @GetMapping("/likeRight")
    @ApiOperation("使用likeRight查询")
    public List<Emp> getLikeRight(@RequestParam String column, @RequestParam String val) {
        return empService.getLikeRight(column, val);
    }

    @GetMapping("/notLikeLeft")
    @ApiOperation("使用notLikeLeft查询")
    public List<Emp> getNotLikeLeft(@RequestParam String column, @RequestParam String val) {
        return empService.getNotLikeLeft(column, val);
    }
}